package org.agile4j.plugin.gun.command;

import java.util.ArrayList;
import java.util.List;

/**
 * 命令 调用者 / 发起者
 * 控制一个或多个命令的发起和执行顺序
 * 
 * @author hanyx
 */
public class Invoker {

	private final List<Resolver> resolvers ;
	
	public Invoker() {
		resolvers = new ArrayList<>() ;
	}
	
	public void record(Resolver resolver) {
		resolvers.add(resolver) ;
	}
	
	public void run() {
		for (Resolver resolver : resolvers) {
			resolver.perform();
		}
	}
}
